<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<iframe></iframe>
<script>
iframe = document.querySelector('iframe');
iframe.contentDocument.onselectstart = () => iframe.remove();

test(() => {
  iframe.contentDocument.execCommand('selectAll');
}, 'Should not crash if selectstart event handler detaches frame');
</script>
